var Ajax = require("./ajax.js")
var app = getApp()

class Remote {
  static control(data, success_callback, error_callback) {
    Ajax.AsyncPost('/light/remote_ctl/', data, (res) => {
      console.log("remote_control_success", res);
    },error_callback);
  }
  static off(data, success_callback, error_callback) {
    Ajax.AsyncPost('/light/remote_ctl/', data, success_callback, error_callback);
  }
  static gettest() {
    console.log("get...");
    Ajax.AsyncGet('/light/remote_get/',{},(res)=>{
      console.log("get",res);
    }, (res)=>{
      console.log("get fail");
      console.log(res);
    });
  }
}

module.exports = Remote